let util = require('../libs/util');
let path = require('path');
let wechat_file = path.join(__dirname, '../config/wechat.txt');
let wechat_ticket_file = path.join(__dirname, '../config/ticket.txt');

exports.wechat = {
    appID: 'wxd36ad1495a8a0a43',
    appSecret: '07d41b55776134594adbaa94e9495998',
    token: '123',
    getAccessToken: ()=> {
      return util.readFileAsync(wechat_file)
    },
    getTicket: ()=> {
      return util.readFileAsync(wechat_ticket_file)
    },
    saveAccessToken: (data)=> {
      let content = JSON.stringify(data)
      return util.writeFileAsync(wechat_file, content)
    },
    saveTicket: (data)=> {
      let content = JSON.stringify(data)
      return util.writeFileAsync(wechat_ticket_file, content)
    }
};
